﻿using DocumentFormat.OpenXml.Lite.SpreadsheetML.Excel.Types;
using DocumentFormat.OpenXml.Lite.SpreadsheetML.Excel.WorksheetElements;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.SpreadsheetML.Excel.Table
{
    [XmlRoot("sortState")]
    public class SortState : XmlSerializable
    {
        [Optional]
        [XmlAttribute("columnSort", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> ColumnSort { get; set; }

        [Optional]
        [XmlAttribute("caseSensitive", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> CaseSensitive { get; set; }

        [Optional]
        [XmlAttribute("sortMethod", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_SortMethod> SortMehod { get; set; }

        [XmlAttribute("ref", Form = XmlSchemaForm.Qualified)]
        public string Reference { get; set; }

        [Optional]
        [XmlElement("sortCondition", Namespace = Constants.ExcelMain)]
        public XmlList<SortCondition> SortConditions { get; set; }

        [Optional]
        [XmlElement("extLst", Namespace = Constants.ExcelMain)]
        public ExtensionList ExtensionList { get; set; }

        public SortState() { }
    }
}
